<?php
namespace app\admin\controller;

use app\common\controller\Back;

class Index extends Back
{
    protected function initialize()
    {
        parent::initialize();
    }
    
    public function index()
    {
        $this->assign($this->site);
        
        return $this->fetch();
    }

    public function version()
    {
        $result = [
            'last' => config('app.app_version'),
            'url'  => '',
        ];
        if($server = json_decode(file_get_contents('https://www.feifeicms.org/service/version'),true)){
            if($server['last'] != $result['last']){
                $result = array_merge($result,$server);
            }
        }
        $this->success('ok','admin/index/index',$result);
    }
}